package org.ala.tiktools.generator.mybatis.creator.entity.pagerCountDO;

import com.mysql.cj.xdevapi.Table;
import org.ala.tiktools.generator.mybatis.config.info.Part;
import org.ala.tiktools.generator.mybatis.creator.entity.EntityInfo;
import org.ala.tiktools.generator.mybatis.dbinfo.TableInfo;
import org.ala.tiktools.generator.mybatis.tools.Tools;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ala
 * @date 2025-03-13 14:28
 */
public class PagerCountInfo {
    protected String pkg;
    protected String className;
    protected TableInfo t;
    protected EntityInfo e;
    protected String pagerCountDO, pagerCountDOClassName;

    protected List<String> imports = new ArrayList<>();

    public static PagerCountInfo build(Part p, TableInfo t, EntityInfo e) {
        PagerCountInfo d = new PagerCountInfo();
        d.pkg = e.getPkg();
        d.className = Tools.upHump(t.getName()) + "PagerCountDO";
        d.t = t;
        d.e = e;

        d.pagerCountDO = p.getOut().getShard().getPagerCount();
        d.pagerCountDOClassName = Tools.parseClassName(d.pagerCountDO);

        d.imports.add(d.pagerCountDO);
        return d;
    }

    public String getPkg() {
        return pkg;
    }

    public void setPkg(String pkg) {
        this.pkg = pkg;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public TableInfo getT() {
        return t;
    }

    public void setT(TableInfo t) {
        this.t = t;
    }

    public EntityInfo getE() {
        return e;
    }

    public void setE(EntityInfo e) {
        this.e = e;
    }

    public String getPagerCountDO() {
        return pagerCountDO;
    }

    public void setPagerCountDO(String pagerCountDO) {
        this.pagerCountDO = pagerCountDO;
    }

    public String getPagerCountDOClassName() {
        return pagerCountDOClassName;
    }

    public void setPagerCountDOClassName(String pagerCountDOClassName) {
        this.pagerCountDOClassName = pagerCountDOClassName;
    }

    public List<String> getImports() {
        return imports;
    }

    public void setImports(List<String> imports) {
        this.imports = imports;
    }
}
